﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using COM.OA.BLL;
using COM.OA.Entity;
using System.Collections.Generic;

public partial class loginyanzheng : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string loginuser=this.Request["u"];
        string password=this.Request["p"];

        String where = "u_username='{0}' and u_password='{1}'";

        where = string.Format(where,loginuser,password);        
        IList<users> userslist=usersBLL.Select(where,true,false);
        if (userslist.Count != 0)
        {
            users uu = userslist[0];
            Session.Add("loginuser", uu);            
            this.Response.Write(string.Format(GetRedirect.REDIRECT, "index.htm"));     
        }
        else
        {
            this.Response.Write(string.Format(GetRedirect.WINALERT, "用户名或密码错误！登陆失败"));
            this.Response.Write(string.Format(GetRedirect.REDIRECT, "login.aspx"));
        }
    }
}
